/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.smitsol.voip.api.impl;

import com.smitsol.voip.api.IdentityFactory;
import com.smitsol.voip.api.domains.User;

/**
 *
 * @author russel
 */
public class IdentityFactoryImpl implements IdentityFactory {

  public String getCustomId(Object object) {
    String id = "";
    if (object instanceof User) {
      User user = (User) object;
      id = new StringBuilder("USER|").append(user.getUsername()).toString();
    }
    return id;
  }

  public String getCustomId(String id, Class clazz) {
    String fabricatedId = "";
    if (clazz.equals(User.class)) {
      fabricatedId = new StringBuilder("USER|").append(id).toString();
    }
    return fabricatedId;
  }
}
